home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 15452 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  971 b 

  1. Path: dispatch.news.demon.net!demon!mckean.demon.co.uk
  2. From: martin@mckean.demon.co.uk (Martin McKean)
  3. Newsgroups: comp.lang.c++
  4. Subject: Newbie question re getting local time
  5. Date: Fri, 05 Apr 1996 16:04:30 GMT
  6. Message-ID: <3165427c.147901903@news.demon.co.uk>
  7. NNTP-Posting-Host: mckean.demon.co.uk
  8. X-NNTP-Posting-Host: mckean.demon.co.uk
  9. X-Newsreader: Forte Agent .99d/32.182
  10.  
  11. Can anyone tell me why the following won't work:
  12.  
  13. int iDay;
  14. LPSYSTEMTIME gLocalTime;
  15. GetLocalTime(gLocalTime);
  16. iDay=gLocalTime.wDay;
  17.  
  18. As far as I can work out the SYSTEMTIME structure is included, and
  19. contains the paramater wDay. The compile error I get is:
  20.  
  21. error C2231: '._SYSTEMTIME::wDay' : left operand points to 'struct',
  22. use '->'
  23.  
  24. But if I change refs to gLocalTime.wDay to gLocalTime->wDay it
  25. compiles, but when debugging it stops at the last line above saying
  26. "Unhandled exception - Access violation".
  27.  
  28. All I want is the day of the month; can anyone help?? (MSVC++4)
  29.  
  30. Thanks,
  31. Martin
  32.